module(..., package.seeall)

function new() 
   return { fst = 1, lst = 0} 
end

function enqueue(q,v) 
   q.lst = q.lst+1 
   q[q.lst] = v
end 

function dequeue(q) 
   if q.fst <= q.lst 
   then 
      local v = q[q.fst] 
      q.fst=q.fst+1 
      return v 
   end 
end

